/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Validations;

import Services.exception.ServiceException;
import Services.StoreServices;
import beans.StoreBean;
import database.daos.DAOException;


/**
 *
 * @author Anthar
 */
public class StoreValidation {

        private StoreServices storeServices;

        public StoreValidation(){
            storeServices = new StoreServices();
        }

        public boolean existStore(String RFC) throws ServiceException{
            try {
                StoreBean store = getStoreServices().searchStore(RFC);
                if (store != null) {
                    return true;
                } else {
                    return false;
                }
            } catch (DAOException ex) {
                throw new ServiceException();
            }
        }

        /**
         * SETTERS Y GETTERS
         */

    /**
     * @return the storeServices
     */
    public StoreServices getStoreServices() {
        return storeServices;
    }

    /**
     * @param storeServices the storeServices to set
     */
    public void setStoreServices(StoreServices storeServices) {
        this.storeServices = storeServices;
    }


}
